package cn.edu.nju.software.zp13.client.assignment9UsingJAXB.assignment3Refactoring.bean;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import cn.edu.nju.software.zp13.client.assignment3.xmlNodeEntity.util.ScoreType;

@XmlType(name="课程成绩类型")
public class CourseScore {
	private String courseId;
	private ScoreType st;
	private Score score;
	
	public CourseScore() {
	}
	
	public CourseScore(String courseId, ScoreType st, Score score) {
		super();
		this.courseId = courseId;
		this.st = st;
		this.score = score;
	}

	public String scoreTypeToString(){
		return st.toString();
	}
	
	@XmlElement(name="成绩")
	public Score getScore() {
		return score;
	}

	public void setScore(Score score) {
		this.score = score;
	}

	@XmlAttribute(name="成绩性质")
	public ScoreType getSt() {
		return st;
	}

	public void setSt(ScoreType st) {
		this.st = st;
	}

	@XmlAttribute(name="课程编号")
	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	@Override
	public CourseScore clone() throws CloneNotSupportedException {
		CourseScore cs=new CourseScore();
		cs.setCourseId(this.getCourseId());
		cs.setSt(this.getSt());
		cs.setScore(new Score(this.score.getStudentId(),this.score.getScore()));
		return cs;
	}
	
	
}
